2021-03-03

This is how a chronicle report looks

This is a showcase of the outputs possible with the {chronicle} R package. For a complete how-to, please refer to the package’s github page.

Barplots

chronicle::add_barplot()

Simple bar plot

Bars broken by other group

Bars sorted by value

Bars sorted by value and broken by another column

Horizontally

Boxplots

chronicle::add_boxplot()

Simple box plot

Box plot by groups

Box plot with jitter

Code

chronicle::add_code()

This is an empty canvas for you to include any code you want.

This is some code:

data.table(iris)[, .N, Species]

It can also be evaluated!

library(data.table)
data.table(iris)[, .N, Species]
##       Species  N
## 1:     setosa 50
## 2: versicolor 50
## 3:  virginica 50

Densities

chronicle::add_density()

Basic density

Density by group

Faceted densities

dygraphs

chronicle::add_dygraph()

Simple dygraph (in static outputs it will be replaced by line plots)

Dygraph by groups

Histograms()

chronicle::add_histogram

Basic histogram

Faceted histogram by groups

Line plots

chronicle::add_lineplot()

Simple line plot

Line plot with trend

Line plot with linear trend

Faceted line plot

Rain cloud plots

chronicle::add_raincloud()

Simple rain cloud

Rain cloud by group

Larger denisty kernel

No boxplot, just the median

With the mean instead of the boxplot

Scatter plots

chronicle::add_scatterplot()

Simple scatter plot

Scatter plot with groups

Faceted scatter plot with trend

Tables

chronicle::add_table()

kable

Sepal.Length Sepal.Width Petal.Length Petal.Width Species
5.1 3.5 1.4 0.2 setosa
4.9 3.0 1.4 0.2 setosa
4.7 3.2 1.3 0.2 setosa
4.6 3.1 1.5 0.2 setosa
5.0 3.6 1.4 0.2 setosa
5.4 3.9 1.7 0.4 setosa

DT

Violins

chronicle::add_violin()

Simple violin plot

Violin plot by group

Big Bonus! report_columns()

chronicle also includes a function called report_columns(), that will create an entire chronicle report for a single dataset. It includes a comprehensive summary of the data through the skimr::skim() function, along with one plot for each column present in the data: bar plots for categorical variables and rain cloud plots for numerical variables. This gives you an immediate view of a dataset with a single line of code!

report_columns(dt = palmerpenguins::penguins,
               by_column = 'species')

you can see the example of this output here

sessionInfo

sessionInfo()
## R version 4.0.3 (2020-10-10)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 10 x64 (build 19042)
## 
## Matrix products: default
## 
## locale:
## [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
## [4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] stringr_1.4.0     chronicle_0.2.5   data.table_1.13.6 magrittr_2.0.1    rlang_0.4.10     
## 
## loaded via a namespace (and not attached):
##  [1] tufte_0.9           lattice_0.20-41     tidyr_1.1.2         ps_1.5.0            zoo_1.8-8           digest_0.6.27      
##  [7] R6_2.5.0            evaluate_0.14       httr_1.4.2          xaringan_0.19       ggplot2_3.3.3       highr_0.8          
## [13] pillar_1.4.7        tictoc_1.0          lazyeval_0.2.2      rstudioapi_0.13     callr_3.5.1         Matrix_1.2-18      
## [19] DT_0.17             rmarkdown_2.6       labeling_0.4.2      splines_4.0.3       webshot_0.5.2       flexdashboard_0.5.2
## [25] rolldown_0.1        readr_1.4.0         htmlwidgets_1.5.3   munsell_0.5.0       tinytex_0.28        compiler_4.0.3     
## [31] xfun_0.20           pkgconfig_2.0.3     mgcv_1.8-33         htmltools_0.5.0     tidyselect_1.1.0    tibble_3.0.4       
## [37] gridExtra_2.3       bookdown_0.21       viridisLite_0.3.0   crayon_1.3.4        dplyr_1.0.2         withr_2.3.0        
## [43] grid_4.0.3          nlme_3.1-151        jsonlite_1.7.2      gtable_0.3.0        lifecycle_0.2.0     scales_1.1.1       
## [49] rmdformats_1.0.1    stringi_1.5.3       farver_2.0.3        viridis_0.5.1       dygraphs_1.1.1.6    ellipsis_0.3.1     
## [55] xts_0.12.1          generics_0.1.0      vctrs_0.3.6         tools_4.0.3         glue_1.4.2          purrr_0.3.4        
## [61] hms_0.5.3           crosstalk_1.1.0.1   prettydoc_0.4.1     processx_3.4.5      yaml_2.2.1          colorspace_2.0-0   
## [67] plotly_4.9.3        knitr_1.31          pagedown_0.13